# schemas/user.py
from pydantic import BaseModel
from schemas.role import RoleOut

class UserCreate(BaseModel):
    username: str
    password: str
    role_id: int | None = None

class UserOut(BaseModel):
    id: int
    username: str
    # role: RoleOut | None
    class Config:
        from_attributes = True

# 登录成功后返回的 token
class Token(BaseModel):
    access_token: str
    token_type: str

